home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / dmedia / dmG722Encode.z / dmG722Encode
Encoding:
Text File  |  1998-10-20  |  6.8 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee((((3333ddddmmmm))))                                            ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      dmG722Encode - implements the ITU (International Telecommunication Union)
  10.      Recommendation G.722 compression.
  11.  
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ddddmmmm____aaaauuuuddddiiiioooouuuuttttiiiillll....hhhh>>>>
  15.  
  16.      DDDDMMMMssssttttaaaattttuuuussss ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee((((DDDDMMMMGGGG777722222222eeeennnnccccooooddddeeeerrrr hhhhaaaannnnddddlllleeee,,,,
  17.                        sssshhhhoooorrrrtttt ****iiiibbbbuuuuffff,,,, uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr ****oooobbbbuuuuffff,,,, iiiinnnntttt nnnnssssaaaammmmpppplllleeeessss))))
  18.  
  19.  
  20. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRR
  21.      _h_a_n_d_l_e    DDDDMMMMGGGG777722222222eeeennnnccccooooddddeeeerrrr structure, created by ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeeerrrrCCCCrrrreeeeaaaatttteeee((((3333ddddmmmm)))),
  22.                specifies the signal processing parameters.
  23.  
  24.  
  25.      _i_b_u_f      pointer to input sample data buffer. The data format is short
  26.                (16-bit).  The samples are assumed to be two's complement.
  27.                Sampling rate must be 16 kHz or less.
  28.  
  29.  
  30.      _o_b_u_f      pointer to output data buffer.  The data format is unsigned
  31.                char (8-bit).
  32.  
  33.  
  34.      _n_s_a_m_p_l_e_s  number of samples in the input buffer to be processed. the
  35.                value of nsamples passed to the G.722 encode/decode routines
  36.                must always be a multiple of 2.  It will fail if nsamples
  37.                exceeds the the maximum value specified when the DMG722encoder
  38.                was created.
  39.  
  40.  
  41. RRRREEEETTTTUUUURRRRNNNNEEEEDDDD VVVVAAAALLLLUUUUEEEE
  42.      Returns DDDDMMMM____FFFFAAAAIIIILLLLUUUURRRREEEE or DDDDMMMM____SSSSUUUUCCCCCCCCEEEESSSSSSSS.
  43.  
  44.  
  45.  
  46. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  47.      ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee((((3333ddddmmmm)))) implements the ITU Recommendation G.722 compression.
  48.      If sampling rate is less than 16 kHz, the algorithm still works, except
  49.      the upper bits contains less useful information.
  50.  
  51.  
  52.      ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee((((3333ddddmmmm)))) algorithm uses bandpass filter operations that convolve
  53.      past input samples with a filter M-coefficient array. The linear phase
  54.      filter has a constant time delay of G = (M-1)/2 samples.
  55.      ddddmmmmGGGG777722222222DDDDeeeeccccooooddddeeee((((3333ddddmmmm)))) algorithm also uses bandpass filter operations.  The
  56.      total delay for operating ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee((((3333ddddmmmm)))) and ddddmmmmGGGG777722222222DDDDeeeeccccooooddddeeee((((3333ddddmmmm)))) will be
  57.      2*G = M-1 samples. This constant is _AU_G722_QMF_DELAY, which is 23.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee((((3333ddddmmmm))))                                            ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      In real time operation, bandpass filtering simply delays the output by 23
  75.      samples. In file conversion expecting N samples in and out, the output
  76.      signal is offset by 23 samples from the first sample.  The application
  77.      may want to discard the first 23 samples returned in output date buffer
  78.      from ddddmmmmGGGG777722222222DDDDeeeeccccooooddddeeee.  The application may also want to flush out an
  79.      additional 23 samples from ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee after feeding in all the input
  80.      data to be compressed.  This flushing operation is performed by calling
  81.      ddddmmmmGGGG777722222222EEEEnnnnccccooooddddeeee with a value nsamples = 23 (the corresponding inbuf will
  82.      typically be bzero'd).
  83.  
  84.  
  85.      ITU Recommendation G.722 compression also uses a linear prediction
  86.      scheme.  This means that the compressed bits, which carrying compressed
  87.      information, are interrelated or interdependent.  If a application calls
  88.      aaaaffffSSSSeeeeeeeekkkkFFFFrrrraaaammmmeeee(((()))) to an offset into the compressed bit stream file and then
  89.      starts reading bits in the middle of the bit stream and decompress them
  90.      with ddddmmmmGGGG777722222222DDDDeeeeccccooooddddeeee((((3333ddddmmmm)))), the interdependency of the bits at the cutting
  91.      point is lost.  The application will initially get back data with a lower
  92.      amplitude than if he had read the same data back during a complete pass
  93.      over the file from the beginning.
  94.  
  95.  
  96.      There is no way to exactly recreate the decoded data in the middle of the
  97.      bit stream file without going all the way back to the beginning.
  98.      However, with a "preroll" value to read ahead a portion of the compressed
  99.      file, application can compensate for the amplitude problem.  We recommend
  100.      2 second "preroll".  The application may also consider adding extra 23
  101.      samples for "preroll" for compensation of the filter delays encountered
  102.      in the encoding and decoding processes, as we discussed above.
  103.  
  104.  
  105. NNNNOOOOTTTTEEEE
  106.      G.722 algorithm was developed for sampling rate of 16 kHz.
  107.  
  108.  
  109. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  110.      dmG722EncoderCreate(3dm), dmG722EncoderDestroy(3dm), dmG722Decode(3dm),
  111.      ITU Recommendation G.722.
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.